﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using SAP.Admin.DAO;


namespace SAP
{
    public partial class Main : System.Web.UI.MasterPage
    {
        private LoginSession CurrentLoginSession;
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionCheck();
            if (!IsPostBack)
            {
                lblUser.Text = CurrentLoginSession.UserName;
            }
        }

        public void SessionCheck()
        {

            if (Session["LoginSession"] != null)
            {
                this.CurrentLoginSession = (LoginSession)Session["LoginSession"];
            }
            else
            {
                Response.Redirect("SessionErrorPage.aspx");
            }

        }    
       


        
       
    }
}